package practice09;

public class Student extends Person{

    private Klass klass;

    public Student(int id, String name, int age, Klass klass) {
        super(id,name,age);
        this.klass = klass;

    }
    public Klass getKlass(){
        return klass;
    }
    private boolean isClassLeader() {
        Student classLeader =  klass.getLeader();
        return this.equals(classLeader);
    }
    public String introduce(){
        if(klass.getLeader() != null) {
            return super.introduce() + " I am a Student. I am Leader of " + klass.getDisplayName() + ".";
        }else{
            return super.introduce() + " I am a Student. I am at "+ klass.getDisplayName() +".";
        }
    }

    public void setClass(Klass klass) {
        this.klass = klass;
    }
}
